import Layout from "@/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";
import home from "@/views/Home/index.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "root",
    component: Layout,
    redirect: { name: "Home" },
    children: [
      {
        path: "home",
        name: "Home",
        component: home,
        meta: {
          title: "首页",
          noCache: true
        }
      },
      {
        path: "history",
        name: "History",
        component: () => import("@/views/History/index.vue"),
        meta: {
          title: "我的创作",
          noCache: true
        }
      },
      {
        path: "member",
        name: "Member",
        component: () => import("@/views/Member/index.vue"),
        meta: {
          title: "我的",
          noCache: true
        }
      },
      {
        path: "packageList/:id?",
        name: "PackageList",
        component: () => import("@/views/PackageList/index.vue"),
        meta: {
          title: "套餐权益",
          noCache: true
        }
      },
      {
        path: "/templateList/:id/:name?", // 使用动态参数
        name: "TemplateList",
        component: () => import("@/views/TemplateList/index.vue"),
        meta: {
          title: "AI数字人",
          noCache: true
        }
      },
      {
        path: "/aiCoinRecord",
        name: "AICoinRecord",
        component: () => import("@/views/AICoinRecord/index.vue"),
        meta: {
          title: "AI币明细",
          noCache: true
        }
      },
      {
        path: "/myHuman/:type?",
        name: "MyHuman",
        component: () => import("@/views/MyHuman/index.vue"),
        meta: {
          title: "我的数字人",
          noCache: true
        }
      },
      {
        path: "/myHumanHistory",
        name: "MyHumanHistory",
        component: () => import("@/views/MyHumanHistory/index.vue"),
        meta: {
          title: "历史记录",
          noCache: true
        }
      },
      {
        path: "/orderList",
        name: "OrderList",
        component: () => import("@/views/OrderList/index.vue"),
        meta: {
          title: "订单列表",
          noCache: true
        }
      },
      {
        path: "/orderDetails/:id/:orderType",
        name: "OrderDetails",
        component: () => import("@/views/OrderDetails/index.vue"),
        meta: {
          title: "订单详情",
          noCache: true
        }
      },
      {
        path: "/spread",
        name: "Spread",
        component: () => import("@/views/Spread/index.vue"),
        meta: {
          title: "推广赚钱",
          noCache: true
        }
      },
      {
        path: "/setting",
        name: "Setting",
        component: () => import("@/views/Setting/index.vue"),
        meta: {
          title: "设置",
          noCache: true
        }
      },
      {
        path: "/templeVideo/:id/:name?",
        name: "TempleVideo",
        component: () => import("@/views/TempleVideo/index.vue"),
        meta: {
          title: "视频模板",
          noCache: true
        }
      },
      {
        path: "/createPictureVideo/:id?",
        name: "CreatePictureVideo",
        component: () => import("@/views/CreatePictureVideo/index.vue"),
        meta: {
          title: "照片说话"
        }
      },
      {
        path: "/aiCopyGenerator/:routeName?",
        name: "AiCopyGenerator",
        component: () => import("@/views/AiCopyGenerator/index.vue"),
        meta: {
          title: "AI文案",
          noCache: true
        }
      },
      {
        path: "/aiCopyGenHistory",
        name: "AiCopyGenHistory",
        component: () => import("@/views/AiCopyGenHistory/index.vue"),
        meta: {
          title: "历史记录",
          noCache: true
        }
      },
      {
        path: "/noTrainVideoIntro",
        name: "NoTrainVideoIntro",
        component: () => import("@/views/NoTrainVideoIntro/index.vue"),
        meta: {
          title: "极速数字人",
          noCache: true
        }
      },
      {
        path: "/generateDetail/:Id",
        name: "GenerateDetail",
        component: () => import("@/views/GenerateDetail/index.vue"),
        meta: {
          title: "视频生成详情",
          noCache: true
        }
      }
    ]
  }
];

export default routes;
